package com.qf.controller;

import com.qf.pojo.reqVo.CourseReq;
import com.qf.pojo.respVo.BaseResp;
import com.qf.service.CourseService;
import com.qf.service.ShopCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/shop")
public class ShopCardController {

    @Autowired
    ShopCardService shopCardService;

    @RequestMapping(value = "/addShopCard",method = RequestMethod.POST)
    public BaseResp addShopCard(@RequestBody CourseReq courseReq, HttpServletRequest httpServletRequest){
        return shopCardService.addShopCard(courseReq,httpServletRequest);
    }

    @RequestMapping("/findShopCardByToken")
    public BaseResp findShopCardByToken(HttpServletRequest request){
        return shopCardService.findShopCardByToken(request);
    }
    @RequestMapping("/delShop")
    public BaseResp delShop(@RequestBody CourseReq courseReq,HttpServletRequest request){
        return shopCardService.delShop(courseReq,request);
    }

}
